﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections.ObjectModel;

namespace OpSatPlan
{
    public class IdentifierDefinition
    {
        private AtomicFormulaDefinition mFormula;
        private IdentifierTypes mType;
        private List<IdentifierDefinition> mSubLits;
        private bool mValue;
        public IdentifierDefinition(AtomicFormulaDefinition formula, bool value, IdentifierTypes type)
        {
            this.mFormula = formula;
            this.mType = type;
            this.mValue = value;
            this.mSubLits = new List<IdentifierDefinition>();
        }
        public void Add(IdentifierDefinition idDef)
        {
            this.mSubLits.Add(idDef);
        }
        public AtomicFormulaDefinition AtomicFormulaDefinition
        {
            get
            {
                return this.mFormula;
            }
        }
        public IdentifierTypes IdentifierType
        {
            get
            {
                return this.mType;
            }
        }
        public bool Value
        {
            get
            {
                return this.mValue;
            }
        }
        public ReadOnlyCollection<IdentifierDefinition> SubIdentifiers
        {
            get
            {
                return new ReadOnlyCollection<IdentifierDefinition>(this.mSubLits);
            }
        }
    }
    public enum IdentifierTypes
    {
        Precondition,
        Effect
    }
}
